<?php echo $this->fetch('header.html'); ?>
<div id="rightTop">
    <p>广告管理</p>
    <ul class="subnav">
        <li><span>管理</span></li>
        <li><a class="btn1" href="index.php?app=adver&amp;enabled=0">已停广告</a></li>
        <li><a class="btn1" href="index.php?app=adver&amp;act=add">新增</a></li>
    </ul>
</div>
<div class="mrightTop">
    <div class="fontl">
        <form method="get">
            <div class="left">
                <input type="hidden" name="app" value="adver" />
                <input type="hidden" name="act" value="index" />
                <select name="ad_type" onchange="location='index.php?app=adver&ad_type='+this.value;">
                <option value="">媒介类型</option>
                <option value="3" <?php if ($_GET['ad_type'] == 3): ?>selected<?php endif; ?>>—图片模式</option>
                <option value="1" <?php if ($_GET['ad_type'] == 1): ?>selected<?php endif; ?>>—代码模式</option>
                <option value="2" <?php if ($_GET['ad_type'] == 2): ?>selected<?php endif; ?>>—模板模式</option>
              </select>
                标题:
                <input type="text" name="ad_name" value="<?php echo htmlspecialchars($this->_var['query']['ad_name']); ?>" />
              <select name="pagenum">
                <option value="20" <?php if ($this->_var['pagenum'] == 20): ?>selected<?php endif; ?>>每页20条</option>
                <option value="50" <?php if ($this->_var['pagenum'] == 50): ?>selected<?php endif; ?>>每页50条</option>
                <option value="100" <?php if ($this->_var['pagenum'] == 100): ?>selected<?php endif; ?>>每页100条</option>
                <option value="150" <?php if ($this->_var['pagenum'] == 150): ?>selected<?php endif; ?>>每页150条</option>
                <option value="200" <?php if ($this->_var['pagenum'] == 200): ?>selected<?php endif; ?>>每页200条</option>
              </select>                
                <input type="submit" class="formbtn" value="查询" />
            </div>

      </form>
    </div>
    <div class="fontr">
        <?php echo $this->fetch('page.top.html'); ?>
    </div>
</div>
<div class="tdare">
    <table width="100%" cellspacing="0" class="dataTable">
        <?php if ($this->_var['articles']): ?>
        <tr class="tatr1">
            <td width="20" class="firstCell"><input type="checkbox" class="checkall" /></td>
            <td align="left">标题</td>
            <td>媒介类型</td>
            <td>投放人</td>
            <td>联系方式</td>
            <td>开始时间</td>
            <td>结束时间</td>
            <td>添加时间</td>
            <td>可用</td>
            <td>排序</td>
            <td>操作</td>
        </tr>
        <?php endif; ?>
        <?php $_from = $this->_var['articles']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'adver');if (count($_from)):
    foreach ($_from AS $this->_var['adver']):
?>
        <tr class="tatr2">
            <td class="firstCell"><input type="checkbox" class="checkitem" value="<?php echo $this->_var['adver']['id']; ?>"/></td>
            <td><a href="index.php?app=adver&amp;act=edit&amp;id=<?php echo $this->_var['adver']['id']; ?>" target="_blank" style="text-decoration:none"><?php echo htmlspecialchars($this->_var['adver']['ad_name']); ?></a></td>
            <td><?php if ($this->_var['adver']['ad_type'] == '1'): ?>代码模式<?php elseif ($this->_var['adver']['ad_type'] == '2'): ?>模板模式<?php else: ?>图片模式<?php endif; ?></td>
            <td><?php echo htmlspecialchars($this->_var['adver']['link_name']); ?></td>
            <td><?php echo htmlspecialchars($this->_var['adver']['link_contact']); ?></td>
            <td><?php echo local_date("Y-m-d H:i:s",$this->_var['adver']['start_time']); ?></td>
            <td><?php echo local_date("Y-m-d H:i:s",$this->_var['adver']['end_time']); ?></td>
            <td><?php echo local_date("Y-m-d H:i:s",$this->_var['adver']['add_time']); ?></td>
            <td><?php if ($this->_var['adver']['enabled'] == '1'): ?>正常<?php else: ?><font color="#FF0000">已停</font><?php endif; ?></td>
            <td><?php if (! $this->_var['adver']['code']): ?><span ectype="inline_edit" fieldname="sort_order" fieldid="<?php echo $this->_var['adver']['id']; ?>" datatype="pint" maxvalue="255" class="editable"><?php echo $this->_var['adver']['sort_order']; ?></span><?php endif; ?></td>
            <td><a href="index.php?app=adver&amp;act=edit&amp;id=<?php echo $this->_var['adver']['id']; ?>" target="_blank">编辑</a></td>
        </tr>
        <?php endforeach; else: ?>
        <tr class="no_data">
            <td colspan="11">没有符合条件的记录</td>
        </tr>
        <?php endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </table>
    <?php if ($this->_var['articles']): ?>
<div id="dataFuncs">
        <div class="pageLinks">
            <?php echo $this->fetch('page.bottom.html'); ?>
        </div>
        <div id="batchAction" class="left paddingT15">
            &nbsp;&nbsp;
            <input class="formbtn batchButton" type="button" value="删除" name="id" uri="index.php?app=adver&act=drop" presubmit="confirm('您确定要删除它吗？');" />
            &nbsp;&nbsp;
        </div>
  </div>
    <div class="clear"></div>
    <?php endif; ?>
</div>
<?php echo $this->fetch('footer.html'); ?>
